<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	
	<xsl:include href="../admin.xsl" />
	<xsl:include href="../cp/path.xsl" />
	
	<xsl:param name="pTypes" select="/data/response/ptypes" />
	<xsl:param name="positions" select="/data/response/positions" />
	
	<!-- Запускаем рендер страницы -->
	<xsl:template match="/data">
		<xsl:apply-templates select="response" />
	</xsl:template>
	
	<xsl:template match="response">
		<xsl:param name="cnt" select="count(object)" />
		
		<xsl:apply-templates select="message" />
		
		<xsl:if test="$cnt = 0">
			<p>Ни одного типа страниц  не создано</p>
		</xsl:if>
		<xsl:if test="$cnt != 0">
			<table class="standart grey" cellspacing="0" cellpadding="0">
				<tbody>
					<tr>
						<th>Название</th>
						<th>Алиас</th>
						<th>Опции</th>
					</tr>
					
					<xsl:apply-templates select="object[@type='banners_page_type']" />
				</tbody>
			</table>
		</xsl:if>
	</xsl:template>
	
	<xsl:template match="object[@type='banners_page_type']">
		<tr>
			<td>
				<a href="{$baseURI}/admin/banners" onclick="editType({@id}); return false;" class="mainlink" title="Редактировать">
					<xsl:value-of select="property[@name='title']/value" />
				</a>
			</td>
			<td>
				<xsl:value-of select="property[@name='alias']/value" />
			</td>
			<td>
				<a href="{$baseURI}/admin/banners" onclick="deleteType({@id}, '{$scode}'); return false;">удалить</a>
			</td>
		</tr>
	</xsl:template>
	
</xsl:stylesheet>